package pers.wchen.mybatis.generate.template.xml;

import pers.wchen.mybatis.generate.template.AbsTemplateAnalysis;
import pers.wchen.mybatis.generate.template.BaseAnalysis;

import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

/**
 * @作者： wchen
 * @描述：
 * @创建时间： 2018/2/9 0:22
 * @版本：Copyright 2018, Inc. All Rights Reserved.
 * @修改信息：
 */
public class XMLTemplateAnalysis extends AbsTemplateAnalysis {


    public XMLTemplateAnalysis() {
        try {
            String rootPath = this.getClass().getClassLoader().getResource("").toURI().getPath() + "xml/";
            System.out.println("rootPath: " + rootPath);
            this.templatePaths = new String[]{
                    rootPath + "xml-delete.tm",
                    rootPath + "dao.tm",
                    rootPath + "xml-select.tm",
                    rootPath + "xml-update.tm",
                    rootPath + "xml-dtl.tm",
                    rootPath + "xml-resultMap.tm"
            };
            this.tempResultMap = new HashMap<String, Map<String, StringBuffer>>();
        }catch (Exception e){
            e.printStackTrace();
        }
    }


    public XMLTemplateAnalysis(String... paths) {
        //自定义路径
    }


    public static void main(String[] args) {
        BaseAnalysis baseAnalysis = new XMLTemplateAnalysis();
        baseAnalysis.analysisTemplate();
        System.out.println(baseAnalysis.getAnalysisResult().toString());


    }
}
